package cn.com.huzo.model.entities.master;

import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 计量单位实体类
 *
 * @author 吴旭
 */
public class UomEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 3747757235766655007L;
    private Long UomId;
    private String OrderNo;
    private String UomName;
    private String IsDecimal;          // 该单位是否允许带小数， '0'：不允许有小数； '1':允许有小数
    private String Description;

    public Long getUomId() {
        return UomId;
    }

    public String getOrderNo() {
        return OrderNo;
    }

    public String getUomName() {
        return UomName;
    }

    public String getIsDecimal() {
        return IsDecimal;
    }

    public String getDescription() {
        return Description;
    }

    public void setUomId(Long UomId) {
        this.UomId = UomId;
    }

    public void setOrderNo(String OrderNo) {
        this.OrderNo = OrderNo;
    }

    public void setUomName(String UomName) {
        this.UomName = UomName;
    }

    public void setIsDecimal(String IsDecimal) {
        this.IsDecimal = IsDecimal;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof UomEntity)) {
            return false;
        }

        final UomEntity that = (UomEntity) o;

        return new EqualsBuilder()
                .append(this.getUomId(), that.getUomId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getUomId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
